home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 94 / CD-ROM 94.iso / util / weban / setup.msi / Cabs.w23.cab / cmdOverviewReport.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2002-07-09  |  5.0 KB  |  176 lines

  1. <?xml version="1.0"?> 
  2. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  3.  
  4. <xsl:variable name="Assessment">
  5.      <c score="1" text="Incomplete Scan"/>
  6.     <c score="2" text="Severe Risk"/>
  7.     <c score="3" text="Potential Risk"/>
  8.     <c score="4" text="Security FYIs"/>
  9.     <c score="5" text="Strong Security"/>
  10. </xsl:variable>
  11.     
  12. <xsl:variable name="FileName" select="'file name here'"></xsl:variable>
  13.     
  14. <xsl:template match="SecScan">
  15.     
  16. <xsl:param name="assess" select="@Grade"/>                    
  17. Computer name:<xsl:value-of select="@Domain"/>\<xsl:value-of select="@Machine"/>
  18. IP address:<xsl:value-of select="@IP"/>
  19. Security report name:<xsl:value-of select="$FileName" />
  20. Scan date:<xsl:value-of select="@Date"/>
  21. <xsl:choose><xsl:when test="@HotfixDataVersion">
  22. Security update database version:<xsl:value-of select="@HotfixDataVersion"/></xsl:when></xsl:choose>    
  23. Security assessment:<xsl:value-of select="document('')/*/xsl:variable[@name='Assessment']/c[@score=$assess]/@text"/>
  24.  
  25. <xsl:choose>
  26. <xsl:when test="Check[@Type='5']">
  27.  
  28.   Security Updates
  29.     <xsl:choose>
  30.     <xsl:when test="Check[@Type='5'][@Cat='1']">
  31.         <xsl:for-each select=".">
  32.             <xsl:apply-templates select="Check[@Type='5'][@Cat='1']">
  33.             </xsl:apply-templates>
  34.         </xsl:for-each>    
  35.     </xsl:when>
  36.     </xsl:choose>
  37. </xsl:when>
  38. </xsl:choose>
  39. <xsl:choose>
  40. <xsl:when test="Check[@Type='1']">
  41.  
  42.   Operating System Scan Results 
  43.     <xsl:choose>
  44.     <xsl:when test="Check[@Type='1'][@Cat='1']">
  45.     Vulnerabilities
  46.         <xsl:for-each select=".">
  47.             <xsl:apply-templates select="Check[@Type='1'][@Cat='1']">
  48.             </xsl:apply-templates>
  49.         </xsl:for-each>    
  50.     </xsl:when>
  51.     </xsl:choose>
  52.     <xsl:choose>
  53.     <xsl:when test="Check[@Type='1'][@Cat='2']">
  54.     Additional System Information
  55.         <xsl:for-each select=".">
  56.             <xsl:apply-templates select="Check[@Type='1'][@Cat='2']">
  57.             </xsl:apply-templates>
  58.         </xsl:for-each>
  59.     </xsl:when>
  60.     </xsl:choose>
  61. </xsl:when>
  62. </xsl:choose>
  63. <xsl:choose>
  64. <xsl:when test="Check[@Type='3']">
  65.  
  66.   Internet Information Services (IIS) Scan Results
  67.     <xsl:choose>
  68.     <xsl:when test="Check[@Type='3'][@Cat='1']">
  69.     Vulnerabilities
  70.         <xsl:for-each select=".">
  71.             <xsl:apply-templates select="Check[@Type='3'][@Cat='1']">    
  72.             </xsl:apply-templates>
  73.         </xsl:for-each>
  74.     </xsl:when>
  75.     </xsl:choose>
  76.     <xsl:choose>
  77.     <xsl:when test="Check[@Type='3'][@Cat='2']">
  78.     Additional System Information
  79.         <xsl:for-each select=".">
  80.             <xsl:apply-templates select="Check[@Type='3'][@Cat='2']">
  81.             </xsl:apply-templates>
  82.         </xsl:for-each>
  83.     </xsl:when>
  84.     </xsl:choose>
  85. </xsl:when>
  86. </xsl:choose>
  87. <!-- One tag per SQL Instance, MBSA V1.1 and later -->
  88. <xsl:choose>
  89.     <xsl:when test="SQLInstance">
  90.  
  91.   SQL Server Scan Results<xsl:for-each select="."><xsl:apply-templates select="SQLInstance"/></xsl:for-each>
  92.     </xsl:when>
  93. </xsl:choose>
  94. <xsl:choose>
  95. <xsl:when test="Check[@Type='2']">
  96.  
  97.   SQL Server Scan Results
  98.     <xsl:choose>
  99.     <xsl:when test="Check[@Type='2'][@Cat='1']">
  100.     Vulnerabilities
  101.         <xsl:for-each select=".">
  102.             <xsl:apply-templates select="Check[@Type='2'][@Cat='1']">        
  103.             </xsl:apply-templates>
  104.         </xsl:for-each>    
  105.     </xsl:when>
  106.     </xsl:choose>
  107.     <xsl:choose>
  108.     <xsl:when test="Check[@Type='2'][@Cat='2']">
  109.     Additional System Information
  110.         <xsl:for-each select=".">
  111.             <xsl:apply-templates select="Check[@Type='2'][@Cat='2']">    
  112.             </xsl:apply-templates>
  113.         </xsl:for-each>    
  114.     </xsl:when>
  115.     </xsl:choose>
  116. </xsl:when>
  117. </xsl:choose>
  118. <xsl:choose>
  119. <xsl:when test="Check[@Type='4']">
  120.  
  121.   Desktop Application Scan Results
  122.     <xsl:choose>
  123.     <xsl:when test="Check[@Type='4'][@Cat='1']">
  124.     Vulnerabilities
  125.         <xsl:for-each select=".">
  126.             <xsl:apply-templates select="Check[@Type='4'][@Cat='1']">
  127.             </xsl:apply-templates>
  128.         </xsl:for-each>
  129.     </xsl:when>
  130.     </xsl:choose>
  131.     <xsl:choose>
  132.     <xsl:when test="Check[@Type='4'][@Cat='2']">
  133.     Additional System Information
  134.         <xsl:for-each select=".">
  135.             <xsl:apply-templates select="Check[@Type='4'][@Cat='2']">
  136.             </xsl:apply-templates>
  137.         </xsl:for-each>
  138.     </xsl:when>
  139.     </xsl:choose>
  140. </xsl:when>
  141. </xsl:choose>
  142. </xsl:template>
  143.     
  144. <!-- SQL Instance section -->
  145. <xsl:template match="SQLInstance">
  146.  
  147.    Instance <xsl:value-of select="@Name"/>
  148.     <xsl:choose>
  149.     <xsl:when test="Check[@Type='2'][@Cat='1']">
  150.  
  151.     Vulnerabilities
  152.         <xsl:for-each select=".">
  153.             <xsl:apply-templates select="Check[@Type='2'][@Cat='1']">
  154.             </xsl:apply-templates>
  155.         </xsl:for-each>
  156.     </xsl:when>
  157.     </xsl:choose>
  158.     <xsl:choose>
  159.     <xsl:when test="Check[@Type='2'][@Cat='2']">
  160.  
  161.     Additional System Information
  162.         <xsl:for-each select=".">
  163.             <xsl:apply-templates select="Check[@Type='2'][@Cat='2']">
  164.             </xsl:apply-templates>
  165.         </xsl:for-each>
  166.     </xsl:when>
  167.     </xsl:choose>
  168. </xsl:template>
  169.  
  170. <xsl:template match="Check">
  171. <xsl:param name="score" select="@Grade"/>
  172.           Issue:  <xsl:value-of select="@Name"/>
  173.        Score:  <xsl:value-of select="document('')/*/xsl:variable[@name='Assessment']/c[@score=$score]/@text"/>
  174.        Result: <xsl:value-of select="Advice"/>
  175. </xsl:template>
  176. </xsl:stylesheet>